package ghxx.data.web.servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import box.data.util.FileServiceUtils;
/**
 * 
 * @author wanglong635@126.com
 *
 */
public class FileAllocationServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

	@Override
	protected void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		request.setCharacterEncoding("UTF-8");
		response.setCharacterEncoding("UTF-8");
		PrintWriter out = response.getWriter();
		
		String fileType = request.getParameter("FileType");
		
		String fileId = FileServiceUtils.allocation(100, fileType);
		out.print(fileId);
		out.flush();
		out.close();
	}
	
	

}
